import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 真假财务信息 */
export interface TfFinance {
          id: number; // 主键
          name?: string; // 姓名
          mobile: string; // 手机号
          idCard: string; // 身份证
          type?: string; // 用户类型
          riskType?: boolean; // 风险类型（0 暂未收录、1 真实财务、2 撸子）
          queryCount?: number; // 查询次数
          remark: string; // 备注
          recordTime?: string | Dayjs; // 收录时间
  }

// 真假财务 API
export const TfFinanceApi = {
  // 查询真假财务分页
  getTfFinancePage: async (params: any) => {
    return await request.get({ url: `/business/tf-finance/page`, params })
  },

  // 查询真假财务详情
  getTfFinance: async (id: number) => {
    return await request.get({ url: `/business/tf-finance/get?id=` + id })
  },

  // 新增真假财务
  createTfFinance: async (data: TfFinance) => {
    return await request.post({ url: `/business/tf-finance/create`, data })
  },


  // 获取真假财务
  getTfFinancesByIds: async (data: TfFinance) => {
    return await request.post({ url: `/business/tf-finance/get/ids`, data })
  },

  // 修改真假财务
  updateTfFinance: async (data: TfFinance) => {
    return await request.put({ url: `/business/tf-finance/update`, data })
  },

  // 删除真假财务
  deleteTfFinance: async (id: number) => {
    return await request.delete({ url: `/business/tf-finance/delete?id=` + id })
  },

  /** 批量删除真假财务 */
  deleteTfFinanceList: async (ids: number[]) => {
    return await request.delete({ url: `/business/tf-finance/delete-list?ids=${ids.join(',')}` })
  },

  // 导出真假财务 Excel
  exportTfFinance: async (params) => {
    return await request.download({ url: `/business/tf-finance/export-excel`, params })
  },
}
